function checkLogin() {
    const user = localStorage.getItem("loggedinUser");
    //If no one is logged in we send an alert and go to login.html
    if (!user) {
        alert("You must logged in to see this page!");
        window.location.href = "../login.html";
    }
}
checkLogin();